home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / rexxutil.zip / RXLIBDIR.CMD < prev    next >
OS/2 REXX Batch file  |  1990-10-02  |  2KB  |  70 lines

  1. /** REXX **************************************************************/
  2. /*                                                                    */
  3. /*  Function Name:  RXLIBDIR                                          */
  4. /*                                                                    */
  5. /*  Description:    Get function directory entries from a Rexx        */
  6. /*                  Macrospace Library.                               */
  7. /*                                                                    */
  8. /*  Author:         W. David Ashley                                   */
  9. /*                                                                    */
  10. /*  Version:        1.0                                               */
  11. /*                                                                    */
  12. /*                                                                    */
  13. /**********************************************************************/
  14.  
  15. /* Check for correct number of input arguments */
  16. if arg() \= 1 then do
  17.    say 'Error: Incorrect input arguments.'
  18.    say
  19.    say 'Syntax: REXTEST3 [d:[path]]filename.ext'
  20.    exit
  21.    end
  22. if length(arg(1)) < 3 then do
  23.    say 'Error: Incorrect input arguments.'
  24.    say
  25.    say 'Syntax: REXTEST3 [d:[path]]filename.ext'
  26.    exit
  27.    end
  28. arg file
  29.  
  30. /* Make REXXUTIL.DLL library functions available */
  31. if rxfuncquery('RexMacroLibDir') = 1 then ,
  32.  call rxfuncadd 'RexMacroLibDir', 'REXXUTIL', 'RexMacroLibDir'
  33.  
  34. /* Read input file */
  35. retc = RexMacroLibDir(arg(1), 'func')
  36. if retc \= 0 then do
  37.    select
  38.       when retc = 1 then do
  39.          say 'Error: Cannot open input file' arg(1)'.'
  40.          exit
  41.          end
  42.       when retc = 2 then do
  43.          say 'Error: Out of memory or memory error.'
  44.          exit
  45.          end
  46.       when retc = 5 then do
  47.          say 'Error: Internal REXXUTIL error. Contact REXXUTIL programmer.'
  48.          exit
  49.          end
  50.       otherwise do
  51.          say 'Error: Unknown error. Contact REXXUTIL programmer.'
  52.          exit
  53.          end
  54.       end
  55.    end
  56.  
  57. /* Output each function directory entry */
  58. if func.0 = 0 then say 'No functions found in file' arg(1)'.'
  59. else do
  60.    say '  Size    Pos     Function Name'
  61.    say '-------- ------ ----------------------------------------------'
  62.    do i = 1 to func.0
  63.       say func.i
  64.       end
  65.    end
  66.  
  67. /* exit function */
  68. call rxfuncdrop 'RexMacroLibDir'
  69. return
  70.